package gameAppLayer;

import com.jme3.collision.CollisionResults;
import com.jme3.math.Ray;
import com.jme3.scene.Node;
import com.jme3.scene.Spatial;

/**
 * Direct access to rootNode from anywhere
 * @author RJ
 *
 */
public class RootNodePortal {
	
	private static Node rootNode;
	
	public RootNodePortal(Node rootNode) {
		this.rootNode = rootNode;		
	}
	
	public static int attachChild(Spatial child) {
		return rootNode.attachChild(child);
	}
	
	public static int detachChild(Spatial child) {
		return rootNode.detachChild(child);
	}
	
	public static void detachAllChildren() {
		rootNode.detachAllChildren();		
	}
	
	public static int collideWith(Ray ray, CollisionResults results) {
		return rootNode.collideWith(ray, results);
	}
	
	public static boolean hasChild(Spatial spatial) {
		return rootNode.hasChild(spatial);
	}
	
	public static Node getRef() {
		return rootNode;
	}
	
	

}
